<?php
	header("Content-Type: application/vnd.ms-excel");
	header("Content-Disposition: attachment; filename=\"liste_produits.xls\"");
?>

<table>
	<caption>Liste des produits</caption>
	<tr>
		<th>Identifiant</th>
		<th>Nom</th>
		<th>Description</th>
		<th>Categorie</th>
		<th>Prix</th>
	</tr>
	<?php
		foreach($produits as $p){
			echo "<tr>";
			echo "<td>" . $p['Product']['id'] . "</td>";
			echo "<td>" . $p['Product']['nom'] . "</td>";
			echo "<td>" . $p['Product']['description'] . "</td>";
			echo "<td>" . $p['Category']['nom'] . "</td>";
			echo "<td>" . $p['Product']['prix'] . "</td>";
			echo "</tr>";
		}
	?>
</table>